/*
  纯函数和不纯的函数
*/

// slice splice
const arr = [1, 2, 3, 4, 5, 6, 7]

console.log(arr.slice(0, 3))
console.log(arr.slice(0, 3))
console.log(arr.slice(0, 3))

console.log(arr.splice(0, 3))
console.log(arr.splice(0, 3))
console.log(arr.splice(0, 3))

function getSum(n1, n2) {
  return n1 + n2
}

console.log(getSum(1, 2))
console.log(getSum(1, 2))
console.log(getSum(1, 2))
